class Loading extends eui.Component implements  eui.UIComponent {
	public constructor() {
		super();
		this.skinName = "LoadingSkin";
		this.addEventListener(egret.Event.ADDED_TO_STAGE,function(){
			//noBorder模式
			this.winW = window.innerWidth;//用户手机屏幕的显示宽度...........
			this.winH = window.innerHeight;//.........
			let winR = this.winW/this.winH;
			this.stageW = this.stage.stageWidth;//根据设计稿设定的舞台的宽度：640........
			this.stageH = this.stage.stageHeight;////根据设计稿设定的舞台的宽度：1136..........
			let stageR:number = this.stageW/this.stageH;
			if(stageR > winR){//裁剪舞台的宽
				this.fly.y = this.stageH - this.fly.height;
				console.log(this.fly.y,"1");
			}else{//裁剪舞台高
				console.log("舞台高被裁剪")
				let ration = this.stageW/this.winW;
				let finStageH = this.stageH/ration;
				let ckipH = (finStageH - this.winH)/2;
				this.fly.y = this.stageH - ckipH*ration-this.fly.height;
				console.log(this.fly.y,"22");
			}
		},this)
	}
	protected partAdded(partName:string,instance:any):void
	{
		super.partAdded(partName,instance);
	}
	//获取部件的方法：声明一个和部件同ID名的属性
	public fly;
	public stageH;
	public winW;
	public winH;
	public stageW;
	protected childrenCreated():void
	{
		super.childrenCreated();
		console.log(this.fly.y,"3");
	}
	//加载进度条
	public onProgress(current: number, total: number): void {
		let ration = this.stageW/this.winW;
		let finStageH = this.stageH/ration;
		let ckipH = (finStageH - this.winH);
		let ratio = current/total*(this.stageH - ckipH*ration);//移动整个屏幕高度的百分比
		this.fly.y = 1086-ratio;
		console.log(ratio,"4");
    }

}